package cn.qihua.action;

import java.util.List;

import org.apache.struts2.json.annotations.JSON;

import cn.qihua.model.SysUser;
import cn.qihua.service.IUserService;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author 米修
 * 
 */

public class ListUserAction extends ActionSupport {

	private static final long serialVersionUID = -6139385216181202199L;
	public String message;
	private boolean success = false;
	private IUserService userService;
	private List<SysUser> listSysUser;

	public String findAll() {
		this.listSysUser = userService.findAll();
		this.setSuccess(true);
		return SUCCESS;
	}

	public String findBySta1() {
		this.setSuccess(true);
		return SUCCESS;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public void setUserService(IUserService userService) {
		this.userService = userService;
	}

	@JSON(name = "root")
	public List<SysUser> getListSysUser() {
		return listSysUser;
	}

	public void setListSysUser(List<SysUser> listSysUser) {
		this.listSysUser = listSysUser;
	}

}
